/*******************************************************************************
 * Copyright(c) 2023 Levetop Semiconductor Co.,Led. All rights reserved.
 * @file     scrollText.h
 * @author   UartTFT Application Team
 * @version  V0.0.1
 * @date     2023-01-11
 * @brief    This file provides UartTFT Application display function
 ********************************************************************************/

#ifndef SCROLLTEXT_H_
#define SCROLLTEXT_H_

#include "type.h"
#include "module_select.h"

/*text scroll*/
typedef struct
{
	uint16_t x;
	uint16_t y;
	uint16_t w;
	uint16_t h;
	uint16_t len;		  // Total pixel length of sliding content
	uint16_t cnt;		  // Record the pixel offset of scrolling
	uint8_t flag;		  // Whether to scroll
	uint16_t y_offset;	  // Record the y coordinate offset of the text content in the buffer
	uint8_t t_d;		  // Frame time interval
	uint8_t t_c;		  // Record time
	uint16_t gap;		  // Distance between tail and start
	uint8_t transparent;  // Show background color
	uint8_t scroll_en;	  // Whether to scroll
	uint8_t pixel_format; // Gray scale
	uint32_t bcolor;

	uint8_t encode;
	uint32_t zk_addr;
	uint32_t fcolor;
	//	uint8_t enbackcolor;
	uint8_t Alignment;
	uint16_t xe;
	uint16_t ye;
	uint16_t len_max;
	uint8_t *c;
	uint16_t buf_w;
	uint16_t font_w;
	uint16_t font_h;

} Scroll_Info;
extern Scroll_Info gScroll_Info[SCROLL_SIZE];
extern uint8_t Scroll_num;
extern uint8_t Scroll_flag;


extern void scroll_text(void);
extern void text_scroll(uint8_t type, uint8_t *buff);
extern uint8_t text_scroll_Once(uint8_t num);


#endif /* SCROLLTEXT_H_ */
